# print('hello')
#
# num = input("请输入一个数字：")
# print(f"您输入的数字是{num}")
import random

# 求四个小数的平均数
# a = input("请输入第一个数：")
# b = input("请输入第二个数：")
# c = input("请输入第三个数：")
# d = input("请输入第四个数：")
#
# a = float(a)
# b = float(b)
# c = float(c)
# d = float(d)
#
# print(f"四个数的平均数是 {(a+b+c+b)/4}")

# 计算1-100的和
# sum = 0
# num1 = 1
# while num1 <= 100:
#     sum += num1
#     num1 += 1
# print(f"1-100的和为 {sum}")
#
# # 计算5的阶乘
# result = 1
# num2 = 1
# while num2 <= 5:
#     result *= num2
#     num2 += 1
# print(f"5的阶乘为 {result}")

# 计算 1!+2!+3!+4!+5!
# sum = 0
# num = 1
# while num <= 5:
#     i = 1
#     result = 1
#     while i <= num:
#         result *= i
#         i += 1
#     sum += result
#     num +=1
# print(f"sum={sum}")

# 打印1-10
# for i in range(1,11):
#     print(i)
# 打印1-10的偶数
# for i in range(2,12,2):
#     print(i)
# 打印1-10的奇数
# for i in range(1,11,2):
#     print(i)
# 打印10-1
# for i in range(10,0,-1):
#     print(i)
# 计算1-10的和
# Mysum = 0
# for i in range(1,101):
#     Mysum += i
# print(f"sum={Mysum}")

# 计算平均值
# Mysum = 0
# count = 0
# while True:
#     num = input("请输入数字（输入！结束：）")
#     if num == "!":
#         break
#     num = float(num)
#     Mysum += num
#     count += 1
# print(f"您输入数字的平均数为：{Mysum / count}")


# 人生重开模拟器
# print("+---------------------------------------+")
# print("|                                       |")
# print("|         花有重开日,人无再少年             |")
# print("|         欢迎来到人生重开模拟器！           |")
# print("|                                       |")
# print("+---------------------------------------+")
#
# while True:
#     print("请输入初始属性，可用点数为20")
#     face = int(input("请输入颜值（1-10）："))
#     iq = int(input("请输入智商（1-10）："))
#     strong = int(input("请输入体质（1-10）："))
#     home = int(input("请输入家境（1-10）："))
#     if face < 0 or face > 10:
#         print("颜值非法，请重新输入！")
#         continue
#     if iq < 0 or iq > 10:
#         print("智商非法，请重新输入！")
#         continue
#     if strong < 0 or strong > 10:
#         print("体质非法，请重新输入！")
#         continue
#     if home < 0 or home > 10:
#         print("家境非法，请重新输入！")
#         continue
#     if face + iq + strong + home > 20:
#         print("可用点数超过20，请重新输入！")
#         continue
#
#     print("初始值设置完成！")
#     print(f"颜值={face}，智商={iq}，体质={strong}，家境={home}")
#     break
#
# point  = random.randint(1,6)
# #print(f"point={point}")
# if point % 2 == 1:
#     gender = "boy"
#     print("你是一个男孩")
# else:
#     gender = "gril"
#     print("你是一个女孩")
#
# # 出生点
# point = random.randint(1,3)
# if home == 10:
#     #第一档
#     print("你出生在帝都，你的父母都是高官政要")
#     face += 1
#     iq += 1
#     strong += 1
#     home += 1
# elif 7 <= home <= 9:
#     #第二档
#     if point == 1:
#         print("你出生在大城市，父母是公务员")
#         face += 2
#     elif point == 2:
#         print("你出生在县城，父母是医生")
#         strong += 2
#     else:
#         print("你出生在县城，父母是教师")
#         iq += 2
# elif 4 <= home <= 6:
#     #第三档
#     if point == 1:
#         print("你出生在镇上，父母是乡镇公务员")
#         face += 1
#     elif point == 2:
#         print("你出生在镇上，父母是乡村医生")
#         strong += 1
#     else:
#         print("你出生在镇上，父母是小老板")
#         home += 1
# else:
#     #第四档
#     if point == 1:
#         print("你出生在农村，父母是辛苦劳作的农民")
#         strong += 1
#         face -= 2
#     elif point == 2:
#         print("你出生在穷乡僻壤，父母是无业游民")
#         home -= 1
#     else:
#         print("你出生在镇上，父母感情不和")
#         strong -= 1
#
# print(f"家境：{home}，智商：{iq}，体质：{strong}，颜值：{face}")
#

# def AddSum(beg,end):
#     Mysum = 0
#     for i in range(beg,end+1):
#         Mysum += i
#     print(Mysum)
#
# AddSum(1,100)
# AddSum(1,1000)
# AddSum(1,10000)


# def func(n):
#     if n == 1:
#         return 1
#     return n * func(n - 1)
#
# # print(func(5) + func(4) + func(3) + func(2) + func(1))
# print(func(120))

# a = [1,2,3,4,5]
# for elem in a:
#     print(elem)

# a = [1,2,3,4,5]
# for i in range(0,len(a)):
#     print(a[i] + 10)

# a = [1,2,3,4,5]
# i = 0
# while i < len(a):
#     print(a[i])
#     i += 1

# a = [1,2,3,4,5]
# print(a)
# a.append(2)
# print(a)
# a.insert(1,2)
# print(a)
# print(1 in a)
# print(100 in a)
#
# print(a.index(1))
# print(a.index(100))

# a = [1,2,3,4,5]
# print(a)
# a.pop()
# print(a)
# a.pop(1)
# print(a)
# a.remove(1)
# print(a)


# a = [1,2,3,4,5]
# b = [6,7,8,9,10]
# c = a + b
# print(c)

# a = [1,2,3,4,5]
# b = [6,7,8,9,10]
# c = a.extend(b)
# print(a)
# print(b)
# print(c)

a = {"id" : 20,
     "name" : "徐霞客"
     }
print(a)
print("id" in a)
print("name" in a)
print(a["id"])
print(a["name"])